<?php /* Smarty version 2.6.27, created on 2014-09-19 21:18:27
         compiled from ../CRM/Upgrade/4.5.0.msg_template/civicrm_msg_template.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('block', 'crmScope', '../CRM/Upgrade/4.5.0.msg_template/civicrm_msg_template.tpl', 1, false),array('function', 'fetch', '../CRM/Upgrade/4.5.0.msg_template/civicrm_msg_template.tpl', 12, false),array('modifier', 'escape', '../CRM/Upgrade/4.5.0.msg_template/civicrm_msg_template.tpl', 15, false),)), $this); ?>
<?php $this->_tag_stack[] = array('crmScope', array('extensionKey' => "")); $_block_repeat=true;smarty_block_crmScope($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><?php 
  $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.5.0.msg_template/message_templates';
  $templates = array();
  foreach (preg_grep('/\.tpl$/', scandir($dir)) as $filename) {
    $parts = explode('_', basename($filename, '.tpl'));
    $templates[] = array('type' => array_pop($parts), 'name' => implode('_', $parts), 'filename' => "$dir/$filename");
  }
  $this->assign('templates', $templates);
 ?>

<?php $_from = $this->_tpl_vars['templates']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['tpl']):
?>
  <?php echo smarty_function_fetch(array('assign' => 'content','file' => $this->_tpl_vars['tpl']['filename']), $this);?>

  SELECT @workflow_id := MAX(id) FROM civicrm_option_value WHERE name = '<?php echo $this->_tpl_vars['tpl']['name']; ?>
';
  SELECT @content := msg_<?php echo $this->_tpl_vars['tpl']['type']; ?>
 FROM civicrm_msg_template WHERE workflow_id = @workflow_id AND is_reserved = 1 LIMIT 1;
  UPDATE civicrm_msg_template SET msg_<?php echo $this->_tpl_vars['tpl']['type']; ?>
 = '<?php echo ((is_array($_tmp=$this->_tpl_vars['content'])) ? $this->_run_mod_handler('escape', true, $_tmp, 'quotes') : smarty_modifier_escape($_tmp, 'quotes')); ?>
' WHERE workflow_id = @workflow_id AND (is_reserved = 1 OR (is_default = 1 AND msg_<?php echo $this->_tpl_vars['tpl']['type']; ?>
 = @content));
<?php endforeach; endif; unset($_from); ?>
<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_crmScope($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>